<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        var xhr = new XMLHttpRequest()
        xhr.open('GET','http://127.0.0.1/AJAX_project/time.php');
        xhr.send();
        // onload是H5里面的内容  xhr的状态永远是4  就没必要用下面的方法了
        xhr.onload = function(){
            console.log(this.readyState);
            console.log(this.responseText);
        };
        // xhr.addEventListener = ("onreadystatrchange",function(){
        //     if(this.readyState == 4) return 
        //     console.log(this.responseText);
        // });
    </script>
</head>
<body>
    
</body>
</html>